#!/bin/sh
# 端口号
PORT=8080

DATE=`date '+%Y%m%d'`
for port in ${PORT}
do
    pid=`netstat -anltp | grep $port | awk '{print $7}' | awk -F"/" '{ print $1 }' | head -1`
    if  [ ! -n "$pid" ] ;then
        continue
    else
        kill -9 $pid
    fi
done
sleep 2

nohup  java -jar -Xms50m -Xmx400m admin-server-app-1.0-SNAPSHOT.jar --spring.config.location=config/  > logs/$DATE.log &

tail -f logs/$DATE.log